
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2547. -- [Ctsc2002]玩具兵 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2547: [Ctsc2002]玩具兵</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>53&nbsp;&nbsp;<span class=green>Solved: </span>22<br>[<a href='submitpage.php?id=2547'>Submit</a>][<a href='problemstatus.php?id=2547'>Status</a>][<a href='bbs.php?id=2547'>Discuss</a>]</center><h2>Description</h2><div class=content><p class="MsoPlainText" style="margin: 0cm 0cm 0pt; text-indent: 24pt"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">小明的爸爸给他买了一盒玩具兵，其中有</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"> K</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个步兵，</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">K</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个骑兵和一个天兵，个个高大威猛，形象逼真。盒子里还有一个</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">M*N</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">棋盘，每个格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">(i,j)</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">都有一个高度</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">H<sub>ij</sub></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">，并且大得足以容纳所有的玩具兵。小明把所有的玩具兵都放到棋盘上去，突然想到了一种很有趣的玩法：任意挑选</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">T</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个不同的格子，并给每个格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">i</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">规定一个重要值</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">R<sub>i&shy;&shy;</sub></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">，游戏的目标就是每次沿东南西北之一的方向把一个玩具兵移动到其相邻的格子中（但不能移动到棋盘外面去），最终使得每个挑选出的格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">i</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">上恰好有</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">R<sub>i</sub></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个玩具兵。小明希望所有的玩具兵都在某个选定的格子中，因此他总是使选出的</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">T</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个格子的重要值之和等于玩具兵的个数。为了增加难度，小明给玩具兵们的移动方式做了一些规定：</span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'">●<span lang="EN-US"><span style="mso-spacerun: yes">&nbsp; </span></span></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">步兵只会往高处爬，因此如果两个格子</span></font><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">和</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">相邻，当且仅当格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">的高度小于或等于</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">，步兵才可以从</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">移动到</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><span lang="EN-US" style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 宋体"><span style="mso-list: Ignore"><font face="宋体">●</font><span style="font: 7pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">骑兵只会往低处跳，因此如果两个格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">和</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">相邻，当且仅当格子</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">的高度大于或等于</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">，骑兵才可以从</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">A</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">移动到</font></span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt">B</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><span lang="EN-US" style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 宋体"><span style="mso-list: Ignore"><font face="宋体">●</font><span style="font: 7pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">天兵技术全面，移动不受任何限制。</span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可是没玩几次，小明就发现这个</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">游戏太难了，他常常玩了好半天也达不到目的。于是，他设计了一种&ldquo;超能力&rdquo;，</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">每使用一次超能力的时候，虽然不能移动任何一个玩具兵，但可对它们进行任意多次交换操作，每次交换两个玩具兵。等这次超能力使用完后又可和平常一样继续移动这些玩具兵。借助强大的超能力，这个游戏是容易玩通的，但是怎样才能让使用超能力的次数最少呢？</span><span lang="EN-US" style="font-size: 12pt; font-family: &quot;Times New Roman&quot;; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang="EN-US"><o:p><font face="宋体" size="3">&nbsp;</font></o:p></span></b></p>
<p></p></div><h2>Input</h2><div class=content><p class="MsoPlainText" align="left" style="margin: 0cm 0cm 0pt; text-align: left"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">第一行包含四个整数：</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">M,N,K,T (2&lt;=M,N&lt;=100, 1&lt;=K&lt;=50, 1&lt;=T&lt;=2K+1)</span><span lang="EN-US" style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><o:p></o:p></span></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><font face="宋体"><span lang="EN-US" style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">第二行包括</span></font><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">2K+1</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">个数对</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">(x<sub>i</sub>,y<sub>i</sub>)</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">，代表各个玩具兵的初始位置。前</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">K</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">个代表</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">步</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">兵，接下来的</span></font><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">K</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">个代表</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">骑兵</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">，最后一个代表</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">天</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">兵。<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><font face="宋体"><span lang="EN-US" style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt">第三行包含</span></font><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">T</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">个三元组</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">(x<sub>i</sub>,y<sub>i</sub>,r<sub>i</sub>)</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">，第</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">i</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">组代表第</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">i</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">个目标格的位置和重要值。<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">以下</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">M</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">行，每行</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">N</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个整数。其中第</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">i</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">行第</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">j</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个数为即格子的高度</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">H<sub>ij</sub></span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">。高度是不超过</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">100</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">的正整数，注意：不同玩具兵的初始位置可能相同。输入数据保证无错，选定的</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">T</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font face="宋体">个格子的重要值之和保证等于</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">2K+1</span><font face="宋体"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span></font></p>
<p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体"><span lang="EN-US"><o:p></o:p></span></font></span></p></div><h2>Output</h2><div class=content><p class="MsoPlainText" style="margin: 0cm 0cm 0pt"><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">仅包含一行，即使用超能力的最小次数</font></span><span lang="EN-US" style="font-size: 12pt; font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt">T</span><span style="font-size: 12pt; mso-bidi-font-size: 10.0pt"><font face="宋体">。</font></span></p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>4  6  2  5<br />
1  1     1  5     4  1     4  5     3  3<br />
1  2  1    2  6  1    3  2  1    3  6  1    4  3  1<br />
3  2  6  1  3  5<br />
2  1  7  4  4  6<br />
2  3  1  4  3  4<br />
4  3  4  3  2  3<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>1</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2547'>Submit</a>][<a href='problemstatus.php?id=2547'>Status</a>][<a href='bbs.php?id=2547'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
